<template>
    <div>
        <van-checkbox v-model="checked" ref="checkbox">复选框</van-checkbox> 
        <van-button v-model="data" type="primary">默认按钮</van-button>
        <van-icon name="chat-o" size="40" />
        <van-image width="100" height="100" src="https://img.yzcdn.cn/vant/cat.jpeg"/>
        <van-popup v-model="show">内容</van-popup>
        <van-cell-group>
          <van-cell title="单元格" value="内容" />
          <van-cell title="单元格" value="内容" label="描述信息" />
        </van-cell-group>
        <van-field v-model="data" placeholder="请输入用户名" />
    </div>
</template>
<script>
    export default {
        data () {
            return {
                msg: "我是page2组件",
                checked:true,
                data:'',
                show:false
            }
        },
         // 注意：组件挂载后才能访问到 ref 对象
        mounted() {
            this.$refs.checkbox.toggle();
        }
    }
</script>